<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>控制台 - 快速开发管理平台</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#ffb74d',
                        secondary: '#e0e0e0',
                        card: '#e53935',
                    }
                }
            }
        }
    </script>
    <style>
        body {
            background-color: #f8f9fa;
        }
        .gradient-bg {
            background: linear-gradient(135deg, #ffb74d 0%, #ffa726 100%);
        }
        .dashboard-bg {
            background-image: url('https://picsum.photos/1920/1080');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            position: relative;
        }
        .dashboard-bg::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 183, 77, 0.7) 100%);
            z-index: 1;
        }
        .dashboard-content {
            position: relative;
            z-index: 2;
            color: #2c3e50;
        }
        .dashboard-content h1,
        .dashboard-content h3 {
            color: #2c3e50;
        }
        .dashboard-content p {
            color: #34495e;
        }
        .sidebar-item:hover {
            background-color: rgba(255, 183, 77, 0.1);
        }
        .sidebar-item.active {
            background-color: rgba(255, 183, 77, 0.2);
            border-left: 4px solid #ffb74d;
        }
        #userDropdown {
            transition: all 0.3s ease;
        }
        .card-red {
            background-color: rgba(229, 57, 53, 0.85);
            backdrop-filter: blur(4px);
            color: white;
            transition: all 0.3s ease;
        }
        .card-red:hover {
            background-color: rgba(229, 57, 53, 0.95);
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(229, 57, 53, 0.3);
        }
        .card-red h3, .card-red p, .card-red i {
            color: white;
        }
    </style>
</head>
<body class="font-sans">
    <div class="flex h-screen bg-gray-100">
        <!-- 侧边栏 -->
        <div class="w-64 bg-white shadow-md">
            <!-- 品牌标识 -->
            <div class="gradient-bg p-6">
                <h1 class="text-xl font-bold text-white">快速开发管理平台</h1>
            </div>
            
            <!-- 导航菜单 -->
            <div class="py-4">
                <div class="px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wider">
                    主菜单
                </div>
                
                <a href="dashboard.html" class="sidebar-item active flex items-center px-6 py-3 text-gray-700">
                    <i class="fas fa-home mr-3 text-primary"></i>
                    <span>控制台</span>
                </a>
                
                <a href="data-analytics-desktop.html" class="sidebar-item flex items-center px-6 py-3 text-gray-700">
                    <i class="fas fa-chart-line mr-3"></i>
                    <span>数据统计</span>
                </a>
                
                <a href="new-plugin-management.html" class="sidebar-item flex items-center px-6 py-3 text-gray-700">
                    <i class="fas fa-puzzle-piece mr-3"></i>
                    <span>插件管理</span>
                </a>
            </div>
        </div>
        
        <!-- 主内容区域 -->
        <div class="flex-1 overflow-y-auto">
            <!-- 顶部导航栏 -->
            <div class="bg-white shadow-sm p-4 flex justify-between items-center">
                <div>
                    <h1 class="text-xl font-bold text-gray-800">控制台</h1>
                </div>
                
                <div class="flex items-center space-x-4">
                    <!-- 用户头像下拉菜单 -->
                    <div class="relative">
                        <button id="userAvatarBtn" class="w-10 h-10 rounded-full bg-gray-200 flex items-center justify-center hover:bg-gray-300 transition-colors">
                            <i class="fas fa-user text-gray-600"></i>
                        </button>
                        
                        <!-- 下拉菜单 -->
                        <div id="userDropdown" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg py-2 z-50">
                            <div class="px-4 py-2 border-b border-gray-100">
                                <p class="text-sm font-medium text-gray-700">用户名</p>
                            </div>
                            <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50" onclick="handleLogout(event)">
                                <i class="fas fa-sign-out-alt mr-2"></i>退出登录
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 主要内容区域 -->
            <div class="dashboard-bg min-h-[calc(100vh-4rem)] flex items-center justify-center">
                <div class="dashboard-content text-center text-white px-4">
                    <h1 class="text-4xl md:text-5xl font-bold mb-6">欢迎回来</h1>
                    <p class="text-xl md:text-2xl mb-8 opacity-90">开始您的开发之旅</p>
                    <div class="grid grid-cols-1 md:grid-cols-3 gap-6 max-w-4xl mx-auto">
                        <a href="data-analytics-desktop.html" class="card-red rounded-xl p-6">
                            <i class="fas fa-chart-line text-3xl mb-4"></i>
                            <h3 class="text-xl font-semibold mb-2">数据统计</h3>
                            <p class="text-sm opacity-80">查看系统运行数据和分析报告</p>
                        </a>
                        <a href="new-plugin-management.html" class="card-red rounded-xl p-6">
                            <i class="fas fa-puzzle-piece text-3xl mb-4"></i>
                            <h3 class="text-xl font-semibold mb-2">插件管理</h3>
                            <p class="text-sm opacity-80">管理您的插件和扩展功能</p>
                        </a>
                        <a href="#" class="card-red rounded-xl p-6">
                            <i class="fas fa-cog text-3xl mb-4"></i>
                            <h3 class="text-xl font-semibold mb-2">系统设置</h3>
                            <p class="text-sm opacity-80">配置系统参数和个性化设置</p>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script>
        // 检查登录状态
        document.addEventListener('DOMContentLoaded', function() {
            const username = localStorage.getItem('username');
            if (username) {
                document.querySelector('#userDropdown p').textContent = username;
            } else {
                // 如果未登录，跳转到登录页
                window.location.href = 'login.html';
            }
        });

        // 处理退出登录
        function handleLogout(event) {
            event.preventDefault();
            localStorage.removeItem('username');
            localStorage.removeItem('token');
            window.location.href = 'login.html';
        }

        // 用户头像点击事件
        const userAvatarBtn = document.getElementById('userAvatarBtn');
        const userDropdown = document.getElementById('userDropdown');

        userAvatarBtn.addEventListener('click', function() {
            userDropdown.classList.toggle('hidden');
        });

        // 点击其他地方关闭下拉菜单
        document.addEventListener('click', function(event) {
            if (!userAvatarBtn.contains(event.target) && !userDropdown.contains(event.target)) {
                userDropdown.classList.add('hidden');
            }
        });
    </script>
</body>
</html> 